package com.seres.user.vo.dept;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.Date;

/**
 * @author Tan-Bowen
 * @version 1.0
 * @description TODO
 * @date 2021/8/24 16:55
 */
public class DeptVo {

    @Data
    @Builder
    @ApiModel("机构信息创建")
    @NoArgsConstructor
    @AllArgsConstructor
    public static class Create {

        @ApiModelProperty("上级id")
        @NotNull(message = "上级部门必填")
        private Long pid;

        @ApiModelProperty("名称")
        @NotBlank(message = "机构名称必填")
        private String name;

        @ApiModelProperty("1启用")
        @NotNull(message = "状态必填")
        private Integer state;

        @ApiModelProperty("地址")
        private String address;

        @ApiModelProperty("机构描述")
        private String remark;

        @ApiModelProperty("创建人")
        private Long createUser;

    }

    @Data
    @Builder
    @ApiModel("机构信息修改")
    @NoArgsConstructor
    @AllArgsConstructor
    public static class Update {

        @ApiModelProperty("主键id")
        @NotNull(message = "id必填")
        private Long id;

        @ApiModelProperty("上级id")
        @NotNull(message = "上级部门必填")
        private Long pid;

        @ApiModelProperty("名称")
        @NotBlank(message = "机构名称必填")
        private String name;

        @ApiModelProperty("地址")
        private String address;

        @ApiModelProperty("1启用")
        @NotNull(message = "状态必填")
        private Integer state;

        @ApiModelProperty("机构描述")
        private String remark;
    }

    @Data
    @Builder
    @ApiModel("机构信息分页结果")
    @NoArgsConstructor
    @AllArgsConstructor
    public static class PageList {

        @ApiModelProperty("主键id")
        private Long id;

        @ApiModelProperty("父级id")
        private Long pid;

        @ApiModelProperty("名称")
        private String name;

        @ApiModelProperty("1启用")
        private Integer state;

        @ApiModelProperty("机构描述")
        private String remark;

        @ApiModelProperty("创建时间")
        @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
        private Date createTime;

        @ApiModelProperty("修改时间")
        @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
        private Date updateTime;

        @ApiModelProperty("创建人")
        private Long createUser;

        @ApiModelProperty("创建人名称")
        private String createName;

//        @ApiModelProperty("上级部门名称")
//        private Long parentName;

    }

    @Data
    @Builder
    @ApiModel("机构信息查询")
    @NoArgsConstructor
    @AllArgsConstructor
    public static class Select {

        @ApiModelProperty("主键id")
        private Long id;

        @ApiModelProperty("父级id")
        private Long pid;

        @ApiModelProperty("名称")
        private String name;

        @ApiModelProperty("1启用")
        private Integer state;

    }

}
